<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="HotelCreateDlg" widgetVar="HotelCreateDialog" modal="true" resizable="false" appendToBody="true" header="#{bundle.CreateHotelTitle}" closeOnEscape="true">

            <h:form id="HotelCreateForm">

                <h:panelGroup id="display">
                    <p:panelGrid columns="2">

                        <p:outputLabel value="#{bundle.CreateHotelLabel_hotelId}" for="hotelId" />
                        <p:inputText id="hotelId" value="#{hotelController.selected.hotelId}" title="#{bundle.CreateHotelTitle_hotelId}" required="true" requiredMessage="#{bundle.CreateHotelRequiredMessage_hotelId}"/>

                        <p:outputLabel value="#{bundle.CreateHotelLabel_hotelName}" for="hotelName" />
                        <p:inputText id="hotelName" value="#{hotelController.selected.hotelName}" title="#{bundle.CreateHotelTitle_hotelName}" size="255" maxlength="255"/>

                        <p:outputLabel value="#{bundle.CreateHotelLabel_numberofStaydays}" for="numberofStaydays" />
                        <p:inputText id="numberofStaydays" value="#{hotelController.selected.numberofStaydays}" title="#{bundle.CreateHotelTitle_numberofStaydays}"/>

                        <p:outputLabel value="#{bundle.CreateHotelLabel_roomType}" for="roomType" />
                        <p:inputText id="roomType" value="#{hotelController.selected.roomType}" title="#{bundle.CreateHotelTitle_roomType}" size="45" maxlength="45"/>

                        <p:outputLabel value="#{bundle.CreateHotelLabel_price}" for="price" />
                        <p:inputText id="price" value="#{hotelController.selected.price}" title="#{bundle.CreateHotelTitle_price}"/>

                        <p:outputLabel value="#{bundle.CreateHotelLabel_checkInDate}" for="checkInDate" />
                        <p:calendar id="checkInDate" pattern="MM/dd/yyyy" value="#{hotelController.selected.checkInDate}" title="#{bundle.EditHotelTitle_checkInDate}"  showOn="button"/>

                        <p:outputLabel value="#{bundle.CreateHotelLabel_product}" for="product" />
                        <p:selectOneMenu id="product" value="#{hotelController.selected.product}" required="true" requiredMessage="#{bundle.EditHotelRequiredMessage_product}" converter="productConverter">
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{productController.items}"
                                           var="productItem"
                                           itemValue="#{productItem}"
                                           itemLabel="#{productItem.productId.toString()}"
                                           />

                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{hotelController.saveNew}" value="#{bundle.Save}" update="display,:HotelListForm:datalist,:growl" oncomplete="handleSubmit(xhr,status,args,HotelCreateDialog);"/>
                    <p:commandButton value="#{bundle.Cancel}" onclick="HotelCreateDialog.hide()"/>
                </h:panelGroup>

            </h:form>

        </p:dialog>

    </ui:composition>

</html>
